package com.bw.biz.controller;


import com.bw.biz.pojo.TbProduct;
import com.bw.biz.service.TbProductService;
import com.bw.core.result.ResponseResult;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 产品表 前端控制器
 * </p>
 *
 * @author lv
 * @since 2021-03-23
 */
@RestController
@RequestMapping("/tb-product")
public class TbProductController {
    @Autowired
    private TbProductService service;

    //测试产品列表
    @GetMapping("/list")
    public ResponseResult list(){
        return service.productList();
    }
    //根据产品名称进行查询
    @PostMapping("/findProductByName")
    public ResponseResult findProductByName(String productName){
        return service.findProductByName(productName);
    }
}
